package java9;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		@SuppressWarnings("rawtypes")
		Set set = new TreeSet();  
		@SuppressWarnings("resource")
		Scanner in = new Scanner(System.in);
		 while(in.hasNext()){
			 String s = in.next();
			 if (s.equals("!!!!!"))break;
			 set.add(s);
		 }
		 System.out.println(set.size());
		for (int i = 0; i < 10 ; i++) {
			System.out.println(set.toArray()[i]);
		}
	}
}